#!/bin/bash
contain_name=$1
image=blog-web:local
path=`pwd`
docker rm -f $contain_name
if [[ $3 = 'prod' ]]; then
    echo "prod"
    mv .env.prod .env
    docker run -d --name $contain_name -p $2:80   $image  /bin/sh
else
    echo "dev"
    mv .env.test .env
    docker run -d --name $contain_name -p $2:80 -v $path:/www/workspace  $image  /bin/sh
fi
